<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="text" name="" id="inputLen" value="" />
		<button onclick="foo()">随机数</button>
		<div id="resultDiv">
			
		</div>
		<script type="text/javascript">
			function foo()
			{
				console.log("foo")
				var len=document.getElementById("inputLen").value
				
				var result=""
				for(var i=0;i<len;i++)
				{
					result+=Math.floor(Math.random()*10)
				}
				
				document.getElementById("resultDiv").innerHTML=result
			}
		</script>
		
		
		
		
		

	</body>
</html>
